// pages/preferential/preferential.js
var WxParse = require('../../wxParse/wxParse.js');
Page({

  /**
   * 页面的初始数据
   */
  data: {
    addtime:"",
    title:""
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.setData({
      tel: wx.getStorageSync('tel')
    })
    console.log(1)
    console.log(options.itemid)
    console.log(55)
      this.getQuestionDetail(options.itemid)
    
  },

  getQuestionDetail: function (itemid) {
    var that = this
    wx.showLoading({
      title: '加载中',
    })
    wx.request({
      url: 'https://miniapp.odeman.com/summercamp/orderlist_detail.php',
      header: {
        'content-type': 'application/json' // 默认值
      },
      data:{
        itemid:itemid
      },
      success(res) {
        wx.hideLoading()
        var data = res.data
        if (data.status == "success") {
          that.setData({
            content: res.data.list.content,
            addtime: data.list.addtime,
            title: data.list.title
          })
          var content = that.data.content;
          WxParse.wxParse('content', 'html', content, that, 5);
        }
      }
    })
  },
})